package com.shop.mall.utils;

/**
 * Created by xushubing on 2016/11/15.
 */
public enum ErrorCode {
    SYSTEM_ERROR(1000001, "系统错误"),
    PARAM_ERROR(1000002, "参数错误"),
    BAD_REQUEST(1000003, "BAD_REQUEST"),
    UPDATE_ERROR(1000004, "更新失败"),
    POST_ONLY(1000005, "仅支持POST"),
    USER_INVALID(1001001, "用户不存在"),
    USER_PRIVILEGE_ERROR(1001002, "用户没有权限"),
    SERVICE_ERROR(1001003, "业务处理失败"),

    POST_INVALID(1002001, "文章不存在"),
    POST_UN_PUBLISH(1002002, "文章已下架"),
    POST_TERM_INVALID(1002003, "文章分类不存在"),

    USERNOTBINDCARD_CODE(1003000, "用户未绑卡"),
    APP_USER_BIND_ERROR(1003001, "用户绑定失败"),
    APP_USER_LOGIN_ERROR(1003002, "用户登陆失败"),
    APP_USER_TOKEN_INVALID(1003003, "登录过期请重新登陆"),
    APP_USER_SEND_SMS_ERROR(1003004, "发送短信失败"),
    APP_USER_SMS_CODE_INVALID(1003005, "短信验证码已过期"),
    APP_USER_SMS_CODE_ERROR(1003006, "短信验证码不正确"),
    APP_USER_PASSWORD_ERROR(1003007, "用户密码不正确"),
    APP_USER_REG_REPEAT_ERROR(1003008, "手机号已经存在"),
    APP_USER_HAD_SEND_SMS(1003009, "短信验证码已经发送"),
    APP_USER_BIND_MOBILE_ERROR(1003010, "手机号已经被绑定"),
    APP_USER_PASSWORD_INVALID(1003011, "用户密码不能为空"),
    APP_USER_CONTACT_INVALID(1003012, "用户联系人不存在"),
    APP_USER_NOT_PAY_ERROR(1004001, "用户没有购买"),
    APP_USER_INFO_ERROR(1004001, "用户信息异常"),
    APP_USER_UPDATE_ERROR(1003010, "用户信息已经完善过"),
    APP_USER_LOGIN_INVALID(1003010, "登录失效,请重新登录!"),
    APP_USER_CONTACT_DEL_FAIL(1003011, "用户联系人删除失败!"),
    APP_USER_ORDER_FAIL_BY_NO_BIND(1003012, "用户未绑定手机号,不能进行后续操作!"),
    APP_USER_NOT_BIND(1003013, "用户未绑定手机号"),
    APP_USER_INFO_BIND(1003014, "用户信息已被绑定"),
    APP_USER_INFO_NEW(1003015, "新用户未绑定手机号"),
    APP_USER_INFO_SCHOOL_NIL(1003015, "支付宝未返回用户学校信息"),
    APP_USER_DEDUCT_NIL(1003016, "无代扣用户信息"),
    APP_USER_AUTO_BIND_FAIL(1004044,"自动绑卡失败"),
    APP_USER_ALREADY_SIGN_DEDUCT(1004008,"已签约代扣"),

    FSOPT_USER_NOT_EXISTS(1003016, "新用户未绑定手机号"),

    WXPAY_SIGN_ERROR(1005001, "微信统一下单失败,签名可能被篡改"),
    WXPAY_ORDER_ERROR(1005002, "微信下单失败，请重试"),
    WXPAY_SERVER_ERROR(1005003, "微信支付过程中出现异常，一般由微信引起! 请联系我们处理此订单。"),
    WXPAY_FAIL(1005004, "微信支付失败"),
    WXPAY_STATUS_ERROR(1005005, "支付状态不正确"),
    PAY_PASS_NOT_SET(1005006, "支付密码未设置"),
    PAY_PASS_INVALID(10050076, "支付密码不正确"),

    ORDER_CANCEL_PAYED_ERROR(1006001, "取消已支付、已取消或者已完成的订单"),
    ORDER_FINISH_ERROR(1006002, "取消已支付或已取消的订单"),
    ORDER_SCORE_EXCHANGE_ERROR(1006003, "积分兑换失败"),
    ORDER_SCORE_EXCHANGE_ZERO_ERROR(1006004, "订单金额不能全部使用积分进行抵扣"),
    ORDER_ERROR(1006005, "支付订单异常"),
    ORDER_NOT_EXISTS_ERROR(1006006, "订单不存在"),
    ORDER_CREATE_EXCEP(1006007, "支付订单异常,用户信息和订单信息不匹配。"),
    PAY_TYPE_ERROR(1006008, "支付类型错误或不支持的支付类型"),
    ORDER_ORCODE_EXPIRE(1006009, "消费二维码已过期"),
    ORDER_ORCODE_USED(1006010, "消费二维码已使用"),
    ORDER_REFUND(1006011, "消费二维码已过期,金额已退换到钱包"),
    ORDER_STATUS_ERROR(1006012, "订单状态不正确"),


    ORDER_SUPPLEMENT_PRINT(1006013, "订单补打失败"),

    DAILY_CHECKINED_ERROR(1007001, "今日已经签到,不能重复签到"),

    APP_USER_REG_CONFIRMPWD_ERROR(1008001, "两次密码不一致"),
    APP_USER_REG_MOBILE_ERROR(1008002, "手机号输入不正确"),

    WITHDRAWAL_ALIPAY_FAIL(1009001, "支付宝提现失败"),
    WITHDRAWAL_WXPAY_FAIL(1009002, "微信提现失败"),
    WITHDRAWAL_NO_ENOUGH_MONEY_ERROR(1009003, "提现失败,余额不足"),
    WITHDRAWAL_MORE_ERROR(1009003, "提现失败,每次提现限额20元"),

    APP_ROLE_NOT_EXISTS_ERROR(1010001, "APP角色不存在"),
    APP_ROLE_NO_PERMISSION_ERROR(1010002, "没有此权限！"),
    WELCOME_BACK_NULL_ERROR(1011001, "欢迎语未设置"),
    IFACE_ERROR(500003, "调用三方接口请求失败");


    private int code;
    private String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
